package com.jiang.daily.Q3392;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/04/27 16:43
 */
class Solution {
    public int countSubarrays(int[] nums) {
        int res = 0;
        for (int i = 2; i < nums.length; i++) {

            if ((nums[i] + nums[i - 2]) * 2 == nums[i - 1]) {
                res++;
            }
        }
        return res;
    }
}
